Produced by Araxis Merge on 2023-03-13 03:00:42 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto v4.0.4/Porto Theme/app/code/Mageplaza/LayeredNavigation/Helper | Data.php | 2022-04-22 07:34:10 +0000 |
| 2 | Porto v4.0.5/Porto Theme/app/code/Mageplaza/LayeredNavigation/Helper | Data.php | 2022-12-08 01:34:28 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 294 |
| Changed | 1 | 2 |
| Inserted | 1 | 1 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | /** | 2 | /** | |||
| 3 | * Mageplaza | 3 | * Mageplaza | |||
| 4 | * | 4 | * | |||
| 5 | * NOTICE OF LICENSE | 5 | * NOTICE OF LICENSE | |||
| 6 | * | 6 | * | |||
| 7 | * This source file is subject to the Mageplaza.com license that is | 7 | * This source file is subject to the Mageplaza.com license that is | |||
| 8 | * available through the world-wide-web at this URL: | 8 | * available through the world-wide-web at this URL: | |||
| 9 | * https://www.mageplaza.com/LICENSE.txt | 9 | * https://www.mageplaza.com/LICENSE.txt | |||
| 10 | * | 10 | * | |||
| 11 | * DISCLAIMER | 11 | * DISCLAIMER | |||
| 12 | * | 12 | * | |||
| 13 | * Do not edit or add to this file if you wish to upgrade this extension to newer | 13 | * Do not edit or add to this file if you wish to upgrade this extension to newer | |||
| 14 | * version in the future. | 14 | * version in the future. | |||
| 15 | * | 15 | * | |||
| 16 | * @category Mageplaza | 16 | * @category Mageplaza | |||
| 17 | * @package Mageplaza_LayeredNavigation | 17 | * @package Mageplaza_LayeredNavigation | |||
| 18 | * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | 18 | * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | |||
| 19 | * @license https://www.mageplaza.com/LICENSE.txt | 19 | * @license https://www.mageplaza.com/LICENSE.txt | |||
| 20 | */ | 20 | */ | |||
| 21 | 21 | |||||
| 22 | namespace Mageplaza\LayeredNavigation\Helper; | 22 | namespace Mageplaza\LayeredNavigation\Helper; | |||
| 23 | 23 | |||||
| 24 | use Magento\Catalog\Model\Layer\Filter\FilterInterface; | 24 | use Magento\Catalog\Model\Layer\Filter\FilterInterface; | |||
| 25 | use Magento\Customer\Model\Session; | 25 | use Magento\Customer\Model\Session; | |||
| 26 | use Magento\Framework\DataObject; | 26 | use Magento\Framework\DataObject; | |||
| 27 | use Magento\Framework\Exception\LocalizedException; | 27 | use Magento\Framework\Exception\LocalizedException; | |||
| 28 | use Magento\Framework\ObjectManagerInterface; | 28 | use Magento\Framework\ObjectManagerInterface; | |||
| 29 | use Magento\Framework\View\Layout; | 29 | use Magento\Framework\View\Layout; | |||
| 30 | use Magento\Store\Model\Store; | 30 | use Magento\Store\Model\Store; | |||
| 31 | use Mageplaza\LayeredNavigation\Model\Layer\Filter; | 31 | use Mageplaza\LayeredNavigation\Model\Layer\Filter; | |||
| 32 | 32 | |||||
| 33 | /** | 33 | /** | |||
| 34 | * Class Data | 34 | * Class Data | |||
| 35 | * @package Mageplaza\LayeredNavigation\Helper | 35 | * @package Mageplaza\LayeredNavigation\Helper | |||
| 36 | */ | 36 | */ | |||
| 37 | class Data extends \Mageplaza\AjaxLayer\Helper\Data | 37 | class Data extends \Mageplaza\AjaxLayer\Helper\Data | |||
| 38 | { | 38 | { | |||
| 39 | const ATTR_PREFIX = 'attr_'; | 39 | const ATTR_PREFIX = 'attr_'; | |||
| 40 | const FIELD_RENDER_CATEGORY_TREE = 'render_category_tree'; | 40 | const FIELD_RENDER_CATEGORY_TREE = 'render_category_tree'; | |||
| 41 | const CATEGORY_TREE_DEPTH = 'category_tree_depth'; | 41 | const CATEGORY_TREE_DEPTH = 'category_tree_depth'; | |||
| 42 | const CATEGORIES_LEVEL = 'categories_level'; | 42 | const CATEGORIES_LEVEL = 'categories_level'; | |||
| 43 | const EXPAND_SUBCATEGORIES = 'expand_subcategories'; | 43 | const EXPAND_SUBCATEGORIES = 'expand_subcategories'; | |||
| 44 | const FILTER_TYPE_SLIDER = 'slider'; | 44 | const FILTER_TYPE_SLIDER = 'slider'; | |||
| 45 | const FILTER_TYPE_LIST = 'list'; | 45 | const FILTER_TYPE_LIST = 'list'; | |||
| 46 | const FILTER_TYPE_TREE = 'tree'; | 46 | const FILTER_TYPE_TREE = 'tree'; | |||
| 47 | 47 | |||||
| 48 | /** @var Filter */ | 48 | /** @var Filter */ | |||
| 49 | protected $filterModel; | 49 | protected $filterModel; | |||
| 50 | 50 | |||||
| 51 | /** | 51 | /** | |||
| 52 | * @param $filters | 52 | * @param $filters | |||
| 53 | * | 53 | * | |||
| 54 | * @return mixed | 54 | * @return mixed | |||
| 55 | */ | 55 | */ | |||
| 56 | public function getLayerConfiguration($filters) | 56 | public function getLayerConfiguration($filters) | |||
| 57 | { | 57 | { | |||
| 58 | $params = $this->_getRequest()->getParams(); | 58 | $params = $this->_getRequest()->getParams(); | |||
| 59 | $filterParams = []; | 59 | $filterParams = []; | |||
| 60 | foreach ($params as $key => $param) { | 60 | foreach ($params as $key => $param) { | |||
| 61 | if ($key === 'amp;dimbaar') { | 61 | if ($key === 'amp;dimbaar') { | |||
| 62 | continue; | 62 | continue; | |||
| 63 | } | 63 | } | |||
| 64 | $param = htmlspecialchars($param, ENT_QUOTES, 'UTF-8'); | 64 | $param = htmlspecialchars($param, ENT_QUOTES, 'UTF-8'); | |||
| 65 | $filterParams[htmlentities($key)] = htmlentities($param); | 65 | $filterParams[htmlentities($key)] = htmlentities($param); | |||
| 66 | } | 66 | } | |||
| 67 | 67 | |||||
| 68 | $config = new DataObject([ | 68 | $config = new DataObject([ | |||
| 69 | 'active' => array_keys($filterParams), | 69 | 'active' => array_keys($filterParams), | |||
| 70 | 'params' => $filterParams, | 70 | 'params' => $filterParams, | |||
| 71 | 'isCustomerLoggedIn' => $this->objectManager->create(Session::class)->isLoggedIn(), | 71 | 'isCustomerLoggedIn' => $this->objectManager->create(Session::class)->isLoggedIn(), | |||
| 72 | 'isAjax' => $this->ajaxEnabled() | 72 | 'isAjax' => $this->ajaxEnabled() | |||
| 73 | ]); | 73 | ]); | |||
| 74 | 74 | |||||
| 75 | $this->getFilterModel()->getLayerConfiguration($filters, $config); | 75 | $this->getFilterModel()->getLayerConfiguration($filters, $config); | |||
| 76 | 76 | |||||
| 77 | return self::jsonEncode($config->getData()); | 77 | return self::jsonEncode($config->getData()); | |||
| 78 | } | 78 | } | |||
| 79 | 79 | |||||
| 80 | /** | 80 | /** | |||
| 81 | * @return Filter | 81 | * @return Filter | |||
| 82 | */ | 82 | */ | |||
| 83 | public function getFilterModel() | 83 | public function getFilterModel() | |||
| 84 | { | 84 | { | |||
| 85 | if (!$this->filterModel) { | 85 | if (!$this->filterModel) { | |||
| 86 | $this->filterModel = $this->objectManager->create(Filter::class); | 86 | $this->filterModel = $this->objectManager->create(Filter::class); | |||
| 87 | } | 87 | } | |||
| 88 | 88 | |||||
| 89 | return $this->filterModel; | 89 | return $this->filterModel; | |||
| 90 | } | 90 | } | |||
| 91 | 91 | |||||
| 92 | /** | 92 | /** | |||
| 93 | * @return ObjectManagerInterface | 93 | * @return ObjectManagerInterface | |||
| 94 | */ | 94 | */ | |||
| 95 | public function getObjectManager() | 95 | public function getObjectManager() | |||
| 96 | { | 96 | { | |||
| 97 | return $this->objectManager; | 97 | return $this->objectManager; | |||
| 98 | } | 98 | } | |||
| 99 | 99 | |||||
| 100 | /** | 100 | /** | |||
| 101 | * @return string[] | 101 | * @return string[] | |||
| 102 | */ | 102 | */ | |||
| 103 | public function getCategoryTreeFields() | 103 | public function getCategoryTreeFields() | |||
| 104 | { | 104 | { | |||
| 105 | return [ | 105 | return [ | |||
| 106 | self::FIELD_RENDER_CATEGORY_TREE, | 106 | self::FIELD_RENDER_CATEGORY_TREE, | |||
| 107 | self::CATEGORY_TREE_DEPTH, | 107 | self::CATEGORY_TREE_DEPTH, | |||
| 108 | self::CATEGORIES_LEVEL, | 108 | self::CATEGORIES_LEVEL, | |||
| 109 | self::EXPAND_SUBCATEGORIES | 109 | self::EXPAND_SUBCATEGORIES | |||
| 110 | ]; | 110 | ]; | |||
| 111 | } | 111 | } | |||
| 112 | 112 | |||||
| 113 | /** | 113 | /** | |||
| 114 | * @param FilterInterface $filter | 114 | * @param FilterInterface $filter | |||
| 115 | * @param null $storeId | 115 | * @param null $storeId | |||
| 116 | * | 116 | * | |||
| 117 | * @return string | 117 | * @return string | |||
| 118 | */ | 118 | */ | |||
| 119 | public function getTooltipContent($filter, $storeId = null) | 119 | public function getTooltipContent($filter, $storeId = null) | |||
| 120 | { | 120 | { | |||
| 121 | try { | 121 | try { | |||
| 122 | $store = $this->storeManager->getStore($storeId); | 122 | $store = $this->storeManager->getStore($storeId); | |||
| 123 | $labels = $filter->getAttributeModel()->getData('tooltip_content'); | 123 | $labels = $filter->getAttributeModel()->getData('tooltip_content'); | |||
| 124 | if (isset($labels[$store->getId()])) { | 124 | if (isset($labels[$store->getId()])) { | |||
| 125 | if (empty($labels[$store->getId()])) { | 125 | if (empty($labels[$store->getId()])) { | |||
| 126 | return $labels[Store::DEFAULT_STORE_ID]; | 126 | return $labels[Store::DEFAULT_STORE_ID]; | |||
| 127 | } | 127 | } | |||
| 128 | 128 | |||||
| 129 | return $labels[$store->getId()]; | 129 | return $labels[$store->getId()]; | |||
| 130 | } | 130 | } | |||
| 131 | 131 | |||||
| 132 | return ''; | 132 | return ''; | |||
| 133 | } catch (LocalizedException $e) { | 133 | } catch (LocalizedException $e) { | |||
| 134 | $this->_logger->error($e); | 134 | $this->_logger->error($e); | |||
| 135 | 135 | |||||
| 136 | return ''; | 136 | return ''; | |||
| 137 | } | 137 | } | |||
| 138 | } | 138 | } | |||
| 139 | 139 | |||||
| 140 | /** | 140 | /** | |||
| 141 | * @param Layout | null $layout | |||||
| 141 | * | 142 | * | |||
| 142 | * @return bool | 143 | * @return bool | |||
| 143 | */ | 144 | */ | |||
| 144 | public function getHtmlHighLight( | 145 | public function getHtmlHighLight($layout = null) | |||
| 145 | { | 146 | { | |||
| 146 | return false;// This Feature only on Ultimate. | 147 | return false;// This Feature only on Ultimate. | |||
| 147 | } | 148 | } | |||
| 148 | } | 149 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.